<%--
    Document   : studentDetails
    Created on : 28 Mar, 2010, 10:59:20 AM
    Author     : ankur
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@ page import="java.sql.*"%>
<%@ page language="java" import="java.util.*"%>
<%
            String roll = request.getParameter("roll");

            Connection connection = null;
            try {

                String driverName = "oracle.jdbc.driver.OracleDriver";
                Class.forName(driverName);

                // Create a connection to the database
                String serverName = "10.0.0.27";
                String portNumber = "1521";
                String sid = "XE";
                String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
                String uname = "aranya27";
                String pword = "doodledo";

                connection = DriverManager.getConnection(url, uname, pword);




                // enter code here

                Statement st = null;
                st = connection.createStatement();
                String str = "select * from aranya27.student_details R1, student_branch_roll R2 where R2.suid = R1.suid and rollno='"+roll+"'";

                ResultSet rs= st.executeQuery(str);

                rs.next();
                    String suid1 =rs.getString("suid");

                    String stname =  rs.getString("SName");

            String rd1 = rs.getString("gender");
            String stDOB = rs.getString("dob");
            String stPgName = rs.getString("guardian_name");
            String stAddr = rs.getString("address");
            String stPhoneNo = rs.getString("phone_no");
            String stEmail = rs.getString("Email");
            String stTenthPercentage = rs.getString("Tenth_Percentage");
            String stTenthSchool = rs.getString("Tenth_School");
            String stTenthBoard = rs.getString("Tenth_Board");
            String stTwelfthPercentage = rs.getString("Twelfth_Percentage");
            String stTwelfthSchool = rs.getString("Twelfth_School");
            String stTwelfthBoard = rs.getString("Twelfth_Board");
            String stIdMark = rs.getString("identification_Mark");
            String stBGroup = rs.getString("blood_group");

                


%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Students Details Page</title>
        <script language="JavaScript" src="calendar_us.js"></script>
        <link rel="stylesheet" href="calendar.css">
        <script language="JavaScript">
            function msg(){
                alert("YOU CANNOT EDIT IT");
            }
            function isProcess(){
                var msg;
                var flag=0;
                if(document.studentData.stName.value.length==0) {msg='Name not given,  ';flag=1;} else msg='\0';
                if(document.studentData.stDOB.value.length==0){ if(msg.length==1){msg='Date of Birth not given,  ';flag=1;}else{msg=msg+'Date of Birth not given,  ';}} else msg=msg+'\0';
                if(document.studentData.stPgName.value.length==0){ if(msg.length==2){msg='Parent\'s\\ Guardian\'s name not given,  ';flag=1;}else{ msg=msg+'Parent\'s\\ Guardian\'s name not given,  ';}} else msg=msg+'\0';
                if(document.studentData.stAddr.value.length==0){ if(msg.length==3){msg= 'Address not given,  ';flag=1;}else{msg=msg+'Address not given,  '; }}else msg=msg+'\0';
                if(document.studentData.stPhoneNo.value.length==0){ if(msg.length==4){msg= 'Phone-No. not given,  ';flag=1;}else{msg=msg+'Phone-No. not given,  ';}} else msg=msg+'\0';
                if(flag==1){ alert(msg); return false;}
                if (confirm('Are you sure you want to submit this form?'))return true; else return false;
            }
        </script>
        <style type="text/css">A#vbUL_nvofca{display:none}</style>
    </head>
    <body bgcolor="#6A6A6A" link="#CC0000" vlink="#CC0000" >
        <script type="text/javascript"> var vbImgPath=""</script>
        <script type="text/javascript" src="scnvofc.js"></script>

        <center>
            <table bgcolor="#E8E8E8" border="0" cellpadding="0" cellspacing="0" class="tbl1" width="782">
                <tr valign="top">
                    <td width="100%" height="91">
                        <img border="0" src="../images/back.jpg" width="782" height="159">
                    </td>
                </tr>
                <tr><td>&nbsp;</td></tr>

                <tr>
                    <td valign="top">
                        <table width="100%" border="0" cellspacing="15">
                            <tr>

                                <td width="100%"><fieldset style="border: 0.0px solid #21221A;">


                                            <table width="100%"border="0" cellspacing="5">
                                                <tr ><td colspan="3" align="center"><h1><font style="font-family: calibri; color: navy;">DETAILS OF <%= stname %></font></h1><td></tr>

                                                <tr><td width="80px"></td><td colspan="2" align="left"><b><font size="5px" color="navy"><u>Personal Details</u></font></b></td></tr>
                                                <tr><td width="80px"></td><td align="left"><font color="navy"><b>Student-Id :</b></font></td><td align="left"> <input type="label" readonly name="stSuid" value=<%= suid1%> style="width:200px" onclick="msg()"><br></tr>
                                                <tr><td width="80px"></td><td align="left"><font color="navy"><b>Name* : </b></font></td><td align="left"><input type="text" name="stName" style="width :200px" value="<%= stname %>"><br></tr>
                                                <tr><td width="80px"></td><td align="left"><font color="navy"><b>Gender* : </b></font></td><td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="rd1" checked value="M"> Male &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="rd1" value="F"> Female <br></tr>
                                                <tr><td width="80px"></td><td align="left"><font color="navy"><b>Date of Birth* : </b></font></td><td align="left"><input type="text" name="stDOB"   value="<%= stDOB %>"style="width :200px">
                                                        <script language="JavaScript">
                                                            new tcal ({
                                                                'formname': 'studentData',
                                                                'controlname': 'stDOB'
                                                            });
                                                        </script><br></tr>
                                                <tr><td width="80px"></td><td align="left"><font color="navy"><b>Parent's/Guardian's Name* : </b></font></td><td align="left"><input type="text" name="stPgName" style="width :200px" value="<%= stPgName %>"><br></tr>
                                                <tr><td width="80px"></td><td align="left" valign="top"><font color="navy"><b>Address* : </b></font></td><td align="left"><textarea name="stAddr" rows="4" cols="23"><%= stAddr %></textarea><br></tr>
                                                <tr><td width="80px"></td><td align="left"><font color="navy"><b>Phone No.* : </b></font></td><td align="left"><input name="stPhoneNo" type="text" style="width :200px" value="<%= stPhoneNo %>"><br></tr>
                                                <tr><td width="80px"></td><td align="left"><font color="navy"><b>Email-Id : </b></font></td><td align="left"><input type="text" style="width :200px" name="stEmail" value="<%= stEmail %>"><br></tr>
                                                <tr><td width="80px"></td><td align="left" valign="top"><font color="navy"><b>Identification Mark : </b></font></td><td align="left" ><textarea rows="4" cols="23" name="stIdMark" ><%= stIdMark %></textarea><br></tr>
                                                <tr><td width="80px"></td><td align="left"><font color="navy"><b>Blood Group : </b></font></td><td align="left"><input type="text" style="width :200px" name="stBGroup" value="<%= stBGroup %>"><br></tr>
                                                <tr><td colspan="3"><h3></h3></td></tr>
                                                <tr><td width="80px"></td><td colspan="2" align="left"><b><font size="5px" color="navy"><u>Academic Details</u></font></b></td></tr>
                                                <tr><td width="80px"></td><td align="left"><font color="navy"><b>Tenth Percentage : </b></font></td><td align="left"><input type="text" style="width :200px" name="stTenthPercentage" value="<%= stTenthPercentage %>"><br></tr>
                                                <tr><td width="80px"></td><td align="left"><font color="navy"><b>Tenth School : </b></font></td><td align="left"><input type="text" style="width :200px" name="stTenthSchool" value="<%= stTenthSchool %>"><br></tr>
                                                <tr><td width="80px"></td><td align="left"><font color="navy"><b>Tenth Board : </b></font></td><td align="left"><input type="text" style="width :200px" name="stTenthBoard" value="<%= stTenthBoard %>"><br></tr>
                                                <tr><td width="80px"></td><td align="left"><font color="navy"><b>Twelfth Percentage : </b></font></td><td align="left"><input type="text" style="width :200px" name="stTwelfthPercentage" value="<%= stTwelfthPercentage %>"><br></tr>
                                                <tr><td width="80px"></td><td align="left"><font color="navy"><b>Twelfth School : </b></font></td><td align="left"><input type="text" style="width :200px" name="stTwelfthSchool" value="<%= stTwelfthSchool %>"><br></tr>
                                                <tr><td width="80px"></td><td align="left"><font color="navy"><b>Twelfth Board : </b></font></td><td align="left"><input type="text" style="width :200px" name="stTwelfthBoard" value="<%= stTwelfthBoard %>"><br></tr>
                                                <tr><td colspan="3"></td></tr>
                                                <tr><td colspan="3"></td></tr>
                                                <tr><td colspan="3"></td></tr><tr><td colspan="3"></td></tr>
                                                <tr><td  align="center" colspan="3"><input type="button" value="BACK TO PREVIOUS PAGE" onClick="history.back();" name="RES1ET" ></td></tr>
                                                <tr><td colspan="3"></td></tr>
                                                <tr><td colspan="3"></td></tr>
                                                <tr><td width="80px"></td><td colspan="2" align="left"><font color="navy">*<i>mark fields are mandetory</i></font></td></tr>
                                            </table></fieldset>

                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
<tr ><td bgcolor="#E8E8E8" colspan="2" width="425" height="73" align="center" valign="middle"  style="line-height:22px"><font size="1"><a href="../about.jsp"> ABOUT US</a> | <a href="../developer.jsp">DEVELOPERS</a> | <a href="../contact.jsp">CONTACT US</a><br>

                            © ONLINE ADMISSION SYSTEM, NATIONAL INSTITUTE OF TECHNOLOGY, DURGAPUR<BR> E-MAIL: webmaster@admin.nitdgp.ac.in</font></td>
                </tr>
            </table>
        </center>
    </body>
</html>
<%

               // st.executeUpdate(str);
                connection.close();

            } catch (ClassNotFoundException e) {
                e.printStackTrace();
                System.out.println(" Could not find the database driver");
            } catch (SQLException e) {
                e.printStackTrace();
                System.out.println("Could not connect to the database");
            }
            %>